﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SaldoKardexGrid.ascx.cs" 
Inherits="UILGestion.AlmacenAdmin.SaldoKardexGrid" %>
<%@ Register Assembly="CustomControls" Namespace="CustomControls" TagPrefix="cc1" %>
<script src="../Scripts/controlGrid.js" type="text/javascript"></script>
<link href="../css/main.css" rel="stylesheet" type="text/css" />
 <script type="text/javascript">
     function SelectAll(frm,id) {

                  var frm = document.getElementById("SaldoKardexGrid1_ListView1_itemPlaceHolderContainer");
                  for (i = 1; i < frm.rows.length; i++) {
                      var checkbox = frm.rows[i].cells[0].childNodes[1];
                      if (checkbox != null)
                          checkbox.checked = document.getElementById(id).checked;
                  }
     };
    </script>

   

 <table width="100%">
        <tr>
        <td>
        
<asp:DataPager ID="pager" PagedControlID="ListView1" runat="server" >
    <Fields>
      <cc1:PagerField NextPageImageUrl="~/Images/arrow_right2.gif" PreviousPageImageUrl="~/images/arrow_left.gif" />
      
    </Fields>
    
</asp:DataPager>
        </td>
        <td align="right">
            <asp:Button ID="buttonDeleteSelectedw" runat="server" CssClass="ms-crm-List-Header"  OnClientClick="return confirm('Eliminar Seleccionados?');" Text="Eliminar Seleccion" 
OnClick="ButtonDeleteSelected_Click"  />

     
        </td>
        </tr>
        </table>


<asp:ListView ID="ListView1" runat="server" OnDataBound="ListView1_DataBound"  
    DataKeyNames="anio,mes,idAlmacen" onitemdatabound="ListView1_ItemDataBound">
    <LayoutTemplate>
        <table id="itemPlaceHolderContainer" border="0" runat="server" class="ms-crm-List-Header">
            <tr id="Tr1" runat="server">
            <th>
            
           <asp:CheckBox runat="server" ID="chkSelectAll" ClientIDMode="Static" onclick="SelectAll('ListView1','chkSelectAll')" />
            </th>
            
                
                <th id="Th1" runat="server">
     
                 <asp:LinkButton ID="lb2" CommandName="Sort" CommandArgument="anio" runat="server" ForeColor="Blue">AÑO</asp:LinkButton>
                </th>
                <th id="Th3" runat="server">
                    <asp:LinkButton ID="lb3" CommandName="Sort" CommandArgument="mes" runat="server" ForeColor="Blue">MES</asp:LinkButton>
                </th>
                <th id="Th2" runat="server">
                    <asp:LinkButton ID="LinkButton1" CommandName="Sort" CommandArgument="almacen" runat="server" ForeColor="Blue">ALMACEN</asp:LinkButton>
                </th>
                
                <th id="Th7" runat="server">
                    <asp:LinkButton ID="LinkButton5" CommandName="Sort" CommandArgument="tipoCambioDollarCierre" runat="server" ForeColor="Blue">T/C</asp:LinkButton>
                </th>
                <th id="Th5" runat="server">
                    <asp:LinkButton ID="LinkButton3" CommandName="Sort" CommandArgument="observacion" runat="server" ForeColor="Blue">OBSERVACION</asp:LinkButton>
                </th>
              
                <th id="Th4" runat="server">
     
                 
                </th>
                 <th id="Th8" runat="server">
     
                 
                </th>
               
                
            </tr>
            <tr id="itemPlaceholder" runat="server">
            </tr>
        </table>



    </LayoutTemplate>
    <ItemTemplate>
        <tr style='background-color: <%# (Container.DataItemIndex % 2 == 0)?"#fff":"#eee" %>'>
            <td>
             <asp:CheckBox runat="server" ID="chkEmployeeSelector"  />
            </td>
            <td >
                    <%# Eval("anio")%> <br />
            </td>
             <td>
                <%# Eval("mes")%><br />
            </td>
            
            <td align="left" width="350px">
            <%# Eval("almacen")%><br />
                 
            </td>
             <td align="right" width="90px">
            <%# Eval("tipoCambioDollarCierre")%><br />
                 
            </td>
             <td align="left" width="250px">
            <%# Eval("observacion")%><br />
                 
            </td>
           

             <td>
               <asp:Hyperlink runat= "server" 
                Text="Documentos" ForeColor="Blue"
                 Target="_blank"  ID="Hyperlink2"
                NavigateUrl='<%# "~/Rpt/PrintForm.aspx?type=CIERRE&anio=" + DataBinder.Eval (Container.DataItem,"anio").ToString() + 
                 "&mes=" + DataBinder.Eval(Container.DataItem,"mes").ToString() +
                 "&idAlmacen=" + DataBinder.Eval(Container.DataItem,"idAlmacen").ToString()+"&resu=0"  %>'
               />  
                </td>


             <td>
               <asp:Hyperlink runat= "server" 
                Text="Insumos" ForeColor="Blue"
                 Target="_blank"  ID="SaldoKardex"
                NavigateUrl='<%# "~/Rpt/PrintForm.aspx?type=CIERRE&anio=" + DataBinder.Eval (Container.DataItem,"anio").ToString() + 
                 "&mes=" + DataBinder.Eval(Container.DataItem,"mes").ToString() +
                 "&idAlmacen=" + DataBinder.Eval(Container.DataItem,"idAlmacen").ToString()+"&resu=1"  %>'
               />  
                </td>
           
           
        </tr>
    </ItemTemplate>
    <EmptyDataTemplate>
        <table id="Table1" runat="server" >
            <tr>
                <td>
                   <h2 style="font-size: x-small; color: #960818">
                        No existe Informacion.</h2>
                </td>
            </tr>
        </table>
    </EmptyDataTemplate>
</asp:ListView>





    
     